1 =============================================================================
2 Windows APPLICATION: VBTabbedWebBrowser Overview
3 =============================================================================
5 /////////////////////////////////////////////////////////////////////////////
8 The sample demonstrates how to create a tabbed WebBrowser.
10 The "Open in new Tab" context command is disabled in WebBorwser by default,
11 you can add a value *.exe=1 (* means the process name)to the key
12 HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_TABBED_BROWSING.
13 This menu will only take effect after the application is restarted.
14 See http://msdn.microsoft.com/en-us/library/ms537636(VS.85).aspx
16 DWebBrowserEvents2 Interface designates an event sink interface that an
17 application must implement to receive event notifications from the underlying
18 ActiveX control, and there is a NewWindow3 Event in this interface. See
19 http://msdn.microsoft.com/en-us/library/aa768283(VS.85).aspx
22 /////////////////////////////////////////////////////////////////////////////
25 Step1. Build this project in VS2010.
27 Step2. Run VBTabbedWebBrowser.exe.
29 Step3. Type http://1code.codeplex.com/ in the Url, and press Enter.
31 Step4. Right click the "Downloads" in the header of the page, and then click
32 "Open in new tab". This application will open the link in a new tab.
34 If the "Open in new tab" is disabled, check "Enable Tab" and restart
38 /////////////////////////////////////////////////////////////////////////////
41 1. Design a class WebBrowserEx that inherits class
42 System.Windows.Forms.WebBrowser. This class can handle NewWindow3 event.
44 The interface DWebBrowserEvents2 designates an event sink interface that
45 an application must implement to receive event notifications from a
46 WebBrowser control or from the Windows Internet Explorer application. The
47 event notifications include NewWindow3 event that will be used in this
50 2. Design a class WebBrowserTabPage that inherits the the
51 System.Windows.Forms.TabPage class and contains a WebBrowserEx property.
52 An instance of this class could be add to a tab control directly.
54 3. Create a UserControl that contains a System.Windows.Forms.TabControl
55 instance. This UserControl supplies the method to create/close the
56 WebBrowserTabPage in the TabControl. It also supplies a Property
57 IsTabEnabled to get or set whether the "Open in new Tab" context menu in
58 WebBrowser is enabled.
60 4. In the MainForm, it supplies controls to enable/disable tab, create/close
61 the tab, and make the WebBrowser GoBack, GoForward or Refresh.
64 /////////////////////////////////////////////////////////////////////////////
67 http://msdn.microsoft.com/en-us/library/aa768283(VS.85).aspx
68 http://msdn.microsoft.com/en-us/library/ms537636(VS.85).aspx
69 http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.createsink.aspx
72 /////////////////////////////////////////////////////////////////////////////